package com.nervenets.web.controller.order;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ShopCartContainer implements Serializable {
    private List<ShopCart> shopCarts = new ArrayList<>();
    private List<ShopCartItem> sortItems = new ArrayList<>();

    public void reset() {
        this.sortItems.clear();
        this.shopCarts.forEach(cart -> cart.getItems().forEach(ShopCartItem::clearFree));
    }
}
